﻿using CarPCBATest.Procedure;
using CarPCBATest.ViewModel;
using MahApps.Metro.Controls;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;

namespace CarPCBATest.View
{
    /// <summary>
    /// HomeView.xaml 的交互逻辑
    /// </summary>
    public partial class HomeView : UserControl
    {
        public HomeView()
        {
            InitializeComponent();

            var model = new HomeViewModel();
            this.DataContext = model;
            model.control = this.VmRenderControl;

            model.SNInputFocusAction = new System.Action(() =>
            {
                Application.Current.Dispatcher.Invoke(() =>
                {
                    this.tbSN.Focus();
                    this.tbSN.SelectAll();
                });
            });
        }
    }
}